﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IGIS.Core;
namespace IGIS.Extensions.Events
{
    public partial class ClearEvents : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            using (wegoEntities db =new wegoEntities())
            {
                var query = from p in  db.EVENTS
                            where p.status =="1"
                            select p;
               ;
               foreach (EVENTS item in query.ToList<EVENTS>())
                {
                    item.status = "0";

                }
               db.SaveChanges();

           //    
               ClientScript.RegisterStartupScript(GetType(), "zoomme", "<script>try{ parent.parent.Refresh();}catch(e){}</script>");
               diverr.InnerText = "פעולה הצליחה";
            }
        }
    }
}